<?php
header("Content-Type: text/html;");
session_start();

define('ROOT_PATH', __DIR__ . '/../../');
define('VENDOR_PATH', __DIR__ . '/../../vendor/');
define('APP_PATH', __DIR__ . '/../../app/');
define('PUBLIC_PATH', __DIR__ . '/../../public/');

require VENDOR_PATH . 'autoload.php';

//加载App配置
require APP_PATH . 'Config/config.php';

//初始化应用程序对象
$app = new \Slim\App($config);

//获取容器对象
$container = $app -> getContainer();

//加载数据库配置
require_once APP_PATH . 'Config/database.php';

//加载容器配置
require_once APP_PATH . 'Config/container.php';

//加载路由配置
require APP_PATH . 'routes.php';

//返回应用程序对象
return $app;
